<?php

namespace app\admin\validate;

use think\Validate;

class InventoryCount extends Validate
{
    protected $rule = [
        'product_id' => 'integer|gt:0|require',
        'warehouse_id' => 'string|require',
        'is_futures' => 'integer|require',
        'arrival_date' => 'date'
    ];
    protected $message = [
        'product_id.require' => 'product_id is required',
        'product_id.integer' => 'product_id must be an integer',
        'product_id.gt' => 'product_id must be greater than 0',
        'warehouse_id.require' => 'warehouse_id is required',
        'warehouse_id.string' => 'warehouse_id must be a string',
        'is_futures.require' => 'is_futures is required',
        'is_futures.integer' => 'is_futures must be an integer',
        'arrival_date.requireIf' => 'arrival_date is required',
        'arrival_date.date' => 'arrival_date must be a date',
    ];
    protected $scene = [
        'getShippedOrderList' => ['product_id', 'warehouse_id'],
        'getLockOrderList' => ['product_id', 'warehouse_id', 'is_futures', 'arrival_date'],
        'getInventoryTotalCount' => ['product_id', 'warehouse_id', 'is_futures', 'arrival_date'],
    ];
}
